package com.example.cupid.service.Impl;

import com.example.cupid.mapper.AdminMapper;
import com.example.cupid.pojo.Admin;
import com.example.cupid.pojo.User;
import com.example.cupid.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

/**
 * 2021/9/19
 **/
@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;
    @Override
    public List<User> findAllByPayDesc() {
        return adminMapper.selectUserByPayDesc();
    }

    @Override
    public User checkUserById(Integer userid) {
        return adminMapper.selectUserById(userid);
    }
    @Override
    public Admin checkUser(String email, String password) {
        return adminMapper.selectAdmin(email,password);
    }

    @Override
    public int userCountTd(Date date) {
        return adminMapper.selectUserCount(date);
    }

    @Override
    public int userCountYd(Date dateYd) {
        return adminMapper.selectUserCountYd(dateYd);
    }

    @Override
    public List<Integer> checkUserId() {
        return adminMapper.selectUserId();
    }

    @Override
    public boolean updatePay(Double money,Integer id) {
        return adminMapper.updatePayMoney(money,id);
    }
}
